package com.cup.wx.micro.task;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.cup.wx.micro.service.WXBaseService;

@Component
public class TokenTask {
	
	private Logger logger = LoggerFactory.getLogger(TokenTask.class);
	
	@Autowired
	private WXBaseService wxBaseService;
	
	@Scheduled(initialDelay = 1000, fixedDelay = 600 * 1000)
    public void getWXAccessToken(){
		
		logger.info("****&&&*** 启动定时任务获取wx acesstoken ***&&&***");
		wxBaseService.getRemoteAccessToken();
		logger.info("****&&&*** 定时任务获取wx acesstoken 成功 ***&&&***");
    }
    
}